package cn.sfrog.project.biz.admin.enums;

import lombok.AllArgsConstructor;
import lombok.Getter;
import lombok.NoArgsConstructor;


@Getter
@NoArgsConstructor
@AllArgsConstructor
public enum CityLevelEnum {
    /**
     * 省
     */
    province(0, "省"),
    city(1, "市"),
    county(2, "区");
    private Integer levelType;
    private String levelTypeName;

    /**
     * 枚举转换
     * @param levelType
     * @return
     */
    public static CityLevelEnum getEnum(Integer levelType){
        for (CityLevelEnum cityLevelEnum : CityLevelEnum.values()) {
            if (levelType.equals(cityLevelEnum.getLevelType())) {
                return cityLevelEnum;
            }
        }
        return null;
    }
}
